package com.lineage.server.model;

import java.util.ArrayList;
import java.util.Iterator;

public class L1ExcludingList {
  private ArrayList<String> _nameList = new ArrayList<>();
  
  public void add(String name) {
    this._nameList.add(name);
  }
  
  public String remove(String name) {
    Iterator<String> iterator = this._nameList.iterator();
    while (iterator.hasNext()) {
      String each = iterator.next();
      if (each.equalsIgnoreCase(name)) {
        this._nameList.remove(each);
        return each;
      } 
    } 
    return null;
  }
  
  public boolean contains(String name) {
    Iterator<String> iterator = this._nameList.iterator();
    while (iterator.hasNext()) {
      String each = iterator.next();
      if (each.equalsIgnoreCase(name))
        return true; 
    } 
    return false;
  }
  
  public boolean isFull() {
    return (this._nameList.size() >= 16);
  }
}
